add_subdirectory(api)
add_subdirectory(rtc_base)
add_subdirectory(audio)
add_subdirectory(common_audio)
add_subdirectory(modules)
add_subdirectory(system_wrappers)
add_subdirectory(third_party)

if (have_neon)
    add_compile_options(-mfloat-abi=soft)
    add_link_options(-mfloat-abi=soft)
endif()

if (have_avx2)
    add_compile_options(-mavx -mfma)
endif()

# add_library(webrtc_audio_processing STATIC
add_library(webrtc_audio_processing SHARED
        ${API_SRC}
        ${AUDIO_SRC}
        ${COMMON_AUDIO_SRC}
        ${AUDIO_PROCESSING_SRC}
        ${SYSTEM_WRAPPERS_SRC}
        ${RTC_BASE_SRC}
        ${THIRD_PARTY_SRC}
        )
target_compile_definitions(webrtc_audio_processing PRIVATE WEBRTC_APM_DEBUG_DUMP=0)

target_include_directories(webrtc_audio_processing PUBLIC
        "${CMAKE_CURRENT_SOURCE_DIR}"
        )

target_link_libraries(webrtc_audio_processing PUBLIC absl::optional absl::throw_delegate absl::strings absl::strings_internal)
if(is_mac OR is_ios)
    target_link_libraries(webrtc_audio_processing PRIVATE "-framework Foundation")
endif()